<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="renderer" content="webkit">
    <title>
        标题
    </title>
    <link href="/bm/Public/css/Mi.css" type="text/css" rel="stylesheet" media="screen,projection"/>
    <link href="/bm/Public/css/materialize.min.css" type="text/css" rel="stylesheet" media="screen,projection">
    <link href="/bm/Public/css/style.min.css" type="text/css" rel="stylesheet" media="screen,projection">
    
    <link href="/bm/Public/css/style.min.css" type="text/css" rel="stylesheet" media="screen,projection"/>

    <style>

        footer {
            position: fixed;
            bottom: 0px;
            left: 0px;
            width: 100%;
            z-index: 10;
        }

    </style>
</head>

<body>

<header id="header" class="page-topbar">
    <!-- 头部-->
    <div class="navbar-fixed ">
        <nav class="navbar-color blue">
            <div class="nav-wrapper">
                <ul>
                    <img class="z-depth-1 hide-on-med-and-down circle responsive-img left"
                         src="/bm/Public/images/logo3.jpg" width="50px"
                         style="margin:5px;margin-left:25px;border-radius:50%">
                    <h1 class="logo-wrapper">

                        <a href="index.html"
                           class="brand-logo">后台管理系统</a>
                    </h1>

                </ul>

                <ul class="right hide-on-med-and-down">
                    <li>
                        <a href="<?php echo U('Admin/Login/logout');?>" data-activates="chat-out"
                           class="waves-effect waves-block waves-light chat-collapse">
                            <i class="mdi-action-exit-to-app"></i>
                        </a>
                    </li>
                </ul>

            </div>
        </nav>
    </div>
</header>


<div id="main">
    <div class="wrapper">
        <aside id="left-sidebar-nav">
            <ul id="slide-out" class="side-nav fixed leftside-navigation">
                <li class="user-details blue darken-2">
                    <div class="row">
                        <div class="col s12 m12 l12">
                            <ul id="profile-dropdown" class="dropdown-content">
                                <li>
                                    <a href="#"><i class="mdi-action-lock-outline"></i>修改密码</a>
                                </li>
                                <li>
                                    <a href="<?php echo U('Admin/Login/logout');?>"><i
                                            class="mdi-hardware-keyboard-tab"></i>退出系统</a>
                                </li>
                            </ul>
                            <a style="font-size: 24px"
                               class="btn-flat dropdown-button waves-effect waves-light white-text profile-btn" href="#"
                               data-activates="profile-dropdown"><?php echo session("Name");?><i
                                    class="mdi-navigation-arrow-drop-down right"></i>
                            </a>
                            <?php switch($_SESSION['Rank']): case "0": ?><p class="user-roal">管理员</p><?php break;?>
                                <?php case "1": ?><p class="user-roal">高权教师</p><?php break;?>
                                <?php case "2": ?><p class="user-roal">教师</p><?php break;?>
                                <?php default: ?>
                                default<?php endswitch;?>
                        </div>
                    </div>
                </li>
                
                    <li class="bold ">
                        <a href="<?php echo U('Admin/Index/index');?>" class="waves-effect waves-cyan">
                            <i
                                    class="mdi-action-home"></i>首页
                        </a>
                    </li>
                    <li class="no-padding">
                        <ul class="collapsible collapsible-accordion">
                            <li class="bold">
                                <a class="collapsible-header waves-effect waves-cyan active">
                                    <i class="mdi-action-view-quilt"></i>比赛管理
                                </a>
                                <div class="collapsible-body">
                                    <ul>

                                        <?php if(($_SESSION['Rank']) == "0"): ?><li class=""><a
                                                    href="<?php echo U('Admin/MatchMag/allMatch');?>">所有比赛</a>
                                            </li>
                                            <?php else: ?>
                                            <li class=""><a
                                                    href="<?php echo U('Admin/MatchMag/deptMatch');?>">本系比赛</a>
                                            </li><?php endif; ?>
                                        <li class=""><a
                                                href="<?php echo U('Admin/MatchMag/issueMatch');?>">我发布的比赛</a>
                                        </li>
                                        <li class=""><a
                                                href="<?php echo U('Admin/MatchMag/unissueMatch');?>">未发布的比赛</a>
                                        </li>
                                        <li class=""><a
                                                href="<?php echo U('Admin/MatchMag/addMatch');?>">创建比赛</a>
                                        </li>
                                    </ul>
                                </div>
                            </li>
                        </ul>
                    </li>
                    <?php if(($_SESSION['Rank']== 0) OR ($_SESSION['Rank']== 1) ): ?><li class="no-padding">
                            <ul class="collapsible collapsible-accordion">
                                <li class="bold"><a
                                        class="collapsible-header waves-effect waves-cyan "><i
                                        class="mdi-action-view-carousel"></i>学院管理</a>
                                    <div class="collapsible-body">
                                        <ul>
                                            <?php if(($_SESSION['Rank']) == "0"): ?><li class=""><a
                                                        href="<?php echo U('Admin/SchoolMag/classMag',array('deptid'=>0));?>">班级管理</a>
                                                </li>
                                                <li class=""><a
                                                        href="<?php echo U('Admin/SchoolMag/deptMag');?>">系部管理</a>
                                                </li>
                                                <?php else: ?>
                                                <li class=""><a
                                                        href="<?php echo U('Admin/SchoolMag/classMag',array('deptid'=>$_SESSION['DeptId']));?>">班级管理</a>
                                                </li><?php endif; ?>

                                        </ul>
                                    </div>
                                </li>
                            </ul>
                        </li><?php endif; ?>

                    <li class="no-padding">
                        <ul class="collapsible collapsible-accordion">
                            <li class="bold"><a
                                    class="collapsible-header waves-effect waves-cyan "><i
                                    class="mdi-action-account-box"></i>系统用户管理</a>
                                <div class="collapsible-body">
                                    <ul>

                                        <?php if(($_SESSION['Rank']== 0) OR ($_SESSION['Rank']== 1) ): if(($_SESSION['Rank']) == "0"): ?><li class=""><a
                                                        href="<?php echo U('Admin/UserMag/adminMag');?>">管理员管理</a>
                                                </li>
                                                <li class=""><a
                                                        href="<?php echo U('Admin/UserMag/tecMag',array('deptid'=>0));?>">教师管理</a>
                                                </li>
                                                <li class=""><a
                                                        href="<?php echo U('Admin/UserMag/stuMag',array('deptid'=>0));?>">学生管理</a>
                                                </li>
                                                <?php else: ?>
                                                <li class=""><a
                                                        href="<?php echo U('Admin/UserMag/tecMag',array('deptid'=>$_SESSION['DeptId']));?>">教师管理</a>
                                                </li>
                                                <li class=""><a
                                                        href="<?php echo U('Admin/UserMag/stuMag',array('deptid'=>$_SESSION['DeptId']));?>">学生管理</a>
                                                </li><?php endif; ?>
                                            <?php else: ?>
                                            <li class=""><a
                                                    href="<?php echo U('Admin/UserMag/stuMag',array('deptid'=>$_SESSION['DeptId']));?>">学生管理</a>
                                            </li><?php endif; ?>
                                        <!--<li class=""><a-->
                                        <!--href="<?php echo U('Admin/AddUser/index');?>">新增用户</a>-->
                                        <!--</li>-->
                                    </ul>
                                </div>
                            </li>
                        </ul>
                    </li>


                    <li class="bold"><a href="<?php echo U('Home/Index/index');?>" class="waves-effect waves-cyan"><i
                            class="mdi-action-label-outline"></i>返回前台</a>
                    </li>
                    <li class="bold"><a href="<?php echo U('Admin/Login/logout');?>" class="waves-effect waves-cyan"><i
                            class="mdi-action-exit-to-app"></i>退出系统</a>
                    </li>
                
            </ul>
            <a href="#" data-activates="slide-out"
               class="sidebar-collapse btn-floating btn-medium waves-effect waves-light hide-on-large-only blue"><i
                    class="mdi-navigation-menu"></i></a>

        </aside>

        <section id="content">


            <div id="breadcrumbs-wrapper">
                <div class="container">
                    <div class="row">
                        <div class="col s12 m12 l12">
                            
    <h5 class="breadcrumbs-title">报名详情</h5>
    <ol class="breadcrumbs">
        <li class="active">报名详情
        </li>
    </ol>

                        </div>
                    </div>
                </div>
            </div>


            <div class="container">
                <div class="section">
                    <div class="row">
                        <div class="col s12 m12 l12">
                            <div class="card-panel">
                                <div class="row">
                                    
    <div class="row center">
        <h2><?php echo getEnrName($enid);?></h2>
    </div>

    <div class="row">
        <div class="col s12 m12 l8">
            <div class="card">
                <div class="card-move-up waves-effect waves-block waves-light">
                    <div class="move-up cyan darken-1">
                        <div>
                            <span class="chart-title white-text">各系报名分析</span>
                        </div>
                        <div class="trending-line-chart-wrapper">
                            <canvas id="trending-line-chart"></canvas>
                        </div>
                    </div>
                </div>
                <div class="card-content">
                    <div class="col s12 m3 l3">
                        <div id="doughnut-chart-wrapper">
                            <canvas id="doughnut-chart"></canvas>
                        </div>
                    </div>
                    <div class="col s12 m2 l2">
                        <ul class="doughnut-chart-legend">
                            <li class="mobile">女</li>
                            <li class="kitchen">男</li>
                        </ul>
                    </div>
                    <div class="col s12 m5 l6">
                        <div>
                            <h5>已报名团队数：<span
                                    class="orange-text"><?php echo sumPeo($enid,EnidToClass($enid));?>/<?php echo EnidToNum($enid);?></span>
                            </h5>
                            <div class="progress">
                                <div class="determinate orange "
                                     style="width: <?php echo PeoPercent(sumPeo($enid,EnidToClass($enid)),EnidToNum($enid));?>%"></div>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>
        <div class="col s12 m12 l4">
            <div class="card">
                <div class="card-move-up waves-effect waves-block waves-light">
                    <div class="move-up green darken-1">
                        <div>
                            <span class="chart-title white-text">三日报名分析</span>
                        </div>
                        <div class="trending-line-chart-wrapper">
                            <canvas id="days"></canvas>
                        </div>
                    </div>
                </div>
            </div>
            <br>
            <div class="card">
                <div class="card-move-up waves-effect waves-block waves-light">
                    <div class="move-up blue darken-1">
                        <div>
                            <span class="chart-title white-text">本周报名分析</span>
                        </div>

                        <div class="trending-line-chart-wrapper">
                            <canvas id="myChart"></canvas>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>

    <div class="row">

        <div class="col s12 m12 l12">
            <a class="modal-trigger waves-effect waves-light green btn" href="<?php echo U('teamGrade',array('enid'=>$enid));?>">成绩分析</a>
            <a class="modal-trigger waves-effect waves-light orange btn" href="#modal1">批量导入成绩</a>
            <a class="modal-trigger waves-effect waves-light blue btn"
               href="<?php echo U('Admin/MatchDetails/outputTeam',array('enid'=>$enid));?>">导出所有</a>
            <div id="modal1" class="modal">
                <form action="<?php echo U('Admin/MatchDetails/importTeamScore');?>" method="post" enctype="multipart/form-data">
                    <div class="modal-content">
                        <div class="row">
                            <div class="col s12 m12 l12">
                                <div class="file-field input-field">
                                    <div class="btn blue">
                                        <span>浏览</span>
                                        <input type="file" name="score">
                                    </div>
                                    <div class="file-path-wrapper">
                                        <input class="file-path validate" type="text" placeholder="请上传成绩Excel表">
                                    </div>
                                </div>
                                <div class="info">
                                    先导出报名学生信息表，然后在报名学生信息表中输入成绩
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <input type="submit" class="waves-effect waves-green btn-flat " value="导入">
                        <a href="#!" class="modal-close waves-effect waves-green btn-flat ">取消</a>
                    </div>
                </form>
            </div>
            <h5>报名学生信息</h5>
            <table class="bordered">
                <thead>
                <tr>
                    <th data-field="id">No</th>
                    <th data-field="name">团队成员</th>
                    <th data-field="addtime">报名时间</th>
                    <th data-field="addtime">成绩</th>
                </tr>
                </thead>

                <tbody>
                <?php if(is_array($ret)): $i = 0; $__LIST__ = $ret;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
                        <td><?php echo ($i); ?></td>
                        <td><?php echo getTeamName($vo[teamid]);?></td>
                        <td><?php echo date("Y-m-d h:i:sa",$vo[addtime]);?></td>
                        <td>
                            <?php if(empty($vo[grade])): ?>成绩未出
                                <?php else: ?>
                                <?php echo ($vo["grade"]); endif; ?>
                        </td>
                    </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                </tbody>
            </table>
        </div>
    </div>



                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </div>


</div>


<footer class="page-footer">
    <div class="footer-copyright blue">
        <div class="container">
            <span>Copyright © 2016 <a class="grey-text text-lighten-4"
                                      href="http://gxsdxy.cn"
                                      target="_blank">广西水利电力职业技术学院</a></span>
            <span class="right"> 技术支持 <a class="grey-text text-lighten-4"
                                         href="#">敏捷软件协会</a></span>
        </div>
    </div>
</footer>

<!--<script type="text/javascript" src="/bm/Public/js/jquery.js"></script>-->
<!--<script type="text/javascript" src="/bm/Public/Admin/js/materialize.min.js"></script>-->
<script type="text/javascript" src="/bm/Public/js/jquery.js"></script>
<script src="/bm/Public/js/jquery-ui.js"></script>
<script src="/bm/Public/js/materialize.js"></script>
<script src="/bm/Public/js/init.js"></script>
<script>
    $(".sidebar-collapse").sideNav();
</script>

    <!-- chartjs -->
    <script type="text/javascript" src="/bm/Public/js/chart.min.js"></script>
    <script>
        $('.modal-trigger').leanModal();
        //各系报名分析
        window.onload = function () {
            var LineChartSampleData = {
                labels: ["水利系", "电力系", "机电系", "信息系", "经济系", "汽车系", "建筑系", "自动化系"],
                datasets: [{
                    label: "My First dataset",
                    fillColor: "rgba(128, 222, 234, 0.6)",
                    strokeColor: "#ffffff",
                    pointColor: "#00bcd4",
                    pointStrokeColor: "#ffffff",
                    pointHighlightFill: "#ffffff",
                    pointHighlightStroke: "#ffffff",
                    data: [<?php echo SumPeoDeptAll($enid);?>]}]
            };

            window.LineChartSample = new Chart(document.getElementById("trending-line-chart").getContext("2d")).Line(LineChartSampleData, {
                scaleGridLineColor: "rgba(255,255,255,0.4)",
                scaleFontSize: 12,
                scaleFontStyle: "normal",
                scaleFontColor: "#fff",
                tooltipFillColor: "rgba(255,255,255,0.8)",
                tooltipFontSize: 12,
                tooltipFontColor: "#000",
                tooltipTitleFontSize: 14,
                tooltipTitleFontStyle: "bold",
                tooltipTitleFontColor: "#000",
                responsive: true
            });


            //本周报名分析
            var data = {
                labels: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
                datasets: [
                    {
                        fillColor: "rgba(220,220,220,0.5)",
                        strokeColor: "rgba(220,220,220,1)",
                        data: [<?php echo SumPeoWeek($enid);?>]
                    }
                ]
            }

            new Chart(document.getElementById("myChart").getContext("2d")).Bar(data, {
                scaleGridLineColor: "rgba(255,255,255,0.4)",
                scaleFontSize: 12,
                scaleFontStyle: "normal",
                scaleFontColor: "#fff",
                tooltipFillColor: "rgba(255,255,255,0.8)",
                tooltipFontSize: 12,
                tooltipFontColor: "#000",
                tooltipTitleFontSize: 14,
                tooltipTitleFontStyle: "bold",
                tooltipTitleFontColor: "#000",
                responsive: true
            });


            //三日报名分析
            var days = {
                labels: ["前天", "昨天", "今天"],
                datasets: [{
                    label: "My First dataset",
                    fillColor: "rgba(128, 222, 234, 0.6)",
                    strokeColor: "#ffffff",
                    pointColor: "#00bcd4",
                    pointStrokeColor: "#ffffff",
                    pointHighlightFill: "#ffffff",
                    pointHighlightStroke: "#ffffff",
                    data: [<?php echo SumPeoDay($enid);?>]
                }]
        }
            ;

            window.LineChartSample = new Chart(document.getElementById("days").getContext("2d")).Line(days, {
                scaleGridLineColor: "rgba(255,255,255,0.4)",
                scaleFontSize: 12,
                scaleFontStyle: "normal",
                scaleFontColor: "#fff",
                tooltipFillColor: "rgba(255,255,255,0.8)",
                tooltipFontSize: 12,
                tooltipFontColor: "#000",
                tooltipTitleFontSize: 14,
                tooltipTitleFontStyle: "bold",
                tooltipTitleFontColor: "#000",
                responsive: true
            });

            //男女分析
            var PieDoughnutChartSampleData = [
                {
                    value: <?php echo sumSexWoman($enid);?>,
                    color: "#F7464A",
                    highlight: "#FF5A5E",
                    label: "女"
                },
                {
                    value: <?php echo sumSexMan($enid);?>,
                    color: "#46BFBD",
                    highlight: "#5AD3D1",
                    label: "男"
                }
            ]

            window.PieChartSample = new Chart(document.getElementById("doughnut-chart").getContext("2d")).Pie(PieDoughnutChartSampleData, {
                responsive: true
            });

        };

    </script>


</body>

</html>